window.getUserId = function(){
	var accessToken = $.cookie('vjinshe');
	console.log(accessToken)
	if( typeof(accessToken) != 'undefined'){
		$.ajax({
		  url: constans.globalUrl+"/support/getBackFront",
		  type: "post",
		  async: false,
		  data: {accessToken:accessToken}, 
		  beforeSend:function(){
			$("body").mLoading("show");
			},
		  complete:function(){
			$("body").mLoading("hide");
			},
		  success: function(data) {
		  	console.log(data)
		  		if(data != "无法获取cookie"){
		  			window.userId = data.userId;
		  		}else{
//		  			alert(data);
		  			console.log(data)
					var refreshToken = $.cookie('vjinshe-refreshToken');
					data = {"refreshToken":refreshToken};
					console.log(data)
					alert('he')
					$.post(constans.globalUrl+"/support/refreshBackFront",data,function(data){
						if(data.code == 'SUCCESS'){
							getUserId();				
						}else{
							alert('您未登录')
							window.location.href = constans.htmlUrl+"/html/login.html";
						}
					})

		  		}
			}
		});
	
	}else{
		alert('您未登录，请先登录')
		window.location.href = constans.htmlUrl+"/html/login.html";
	}


}
